home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / mlib / include / mcomplex.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-26  |  1.2 KB  |  38 lines

  1.  
  2. #ifndef __MCOMPLEX_H
  3. #define __MCOMPLEX_H
  4.  
  5. #include <math.h>
  6.  
  7. #define COMPLEX_ID           0x010A
  8.  
  9. typedef struct tagFPOINT{
  10.     float x;
  11.     float y;
  12. }FPOINT;
  13.  
  14. class Complex : public MObject {
  15. public:
  16.     float                    real;
  17.     float                    imag;
  18. public:
  19.                  Complex (void);
  20.                  Complex (float Real, float Imag);
  21.     Complex&                 operator= (const Complex& number);
  22.     Complex&                 operator= (const FPOINT& number);
  23.     Complex&                 operator+ (const Complex& number);
  24.     Complex&                 operator- (const Complex& number);
  25.     friend Complex&          operator+ (const Complex& num1, const Complex& num2);
  26.     Complex&                 operator* (const Complex& number);
  27.     Complex&                 operator* (float number);
  28.     Complex&                 operator/ (const Complex& number);
  29.     float                    Magnitude (void);
  30.     void                 Normalize (void);
  31.     friend Complex&          sin (Complex&);
  32.     friend Complex&          cos (Complex&);
  33.     virtual inline classType isA (void) {return (COMPLEX_ID);};
  34.                 ~Complex (void);
  35. };
  36.  
  37. #endif
  38.